package io.renren.modules.erp.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.renren.modules.erp.entity.AccountHead;
import io.renren.modules.erp.entity.MaterialCategory;
import io.renren.modules.erp.vo.TreeNode;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface MaterialCategoryService extends IService<MaterialCategory> {

    MaterialCategory getMaterialCategory(long id)throws Exception;

    List<MaterialCategory> getMaterialCategoryListByIds(String ids)throws Exception ;

    List<MaterialCategory> getMaterialCategory()throws Exception ;

    List<MaterialCategory> getAllList(Long parentId)throws Exception ;
    List<MaterialCategory> getMCList(Long parentId)throws Exception ;
    List<MaterialCategory> select(String name, Integer parentId, int currPage, int pageSize) throws Exception;
    Long countMaterialCategory(String name, Integer parentId) throws Exception;

    int insertMaterialCategory(String beanJson, HttpServletRequest request)throws Exception;

    int updateMaterialCategory(String beanJson, Long id, HttpServletRequest request) throws Exception;
    int deleteMaterialCategory(Long id, HttpServletRequest request)throws Exception ;

    int batchDeleteMaterialCategory(String ids, HttpServletRequest request)throws Exception ;

    int checkIsNameExist(Long id, String name)throws Exception ;
    List<MaterialCategory> findById(Long id)throws Exception;
    List<TreeNode> getMaterialCategoryTree(Long id) throws Exception;
    int addMaterialCategory(MaterialCategory mc ,Long userId) throws Exception ;
    int batchDeleteMaterialCategoryByIds(String ids,Long userId) throws Exception ;
    int editMaterialCategory(MaterialCategory mc,Long userId) throws Exception;
    void  checkMaterialCategorySerialNo(MaterialCategory mc)throws Exception ;
    int batchDeleteMaterialCategoryByIdsNormal(String ids,Long userId) throws Exception ;
    Long getCategoryIdByName(String name);
}
